<!--suppress ALL -->
<include file="./Template/header.html" />

<link rel="stylesheet" type="text/css" href="/Template/css/exam.css">
<link rel="stylesheet" type="text/css" href="/Template/css/checkbox.css">
<script type="text/javascript" src="/Template/js/amazeui.js"></script>
<script type="text/javascript" src="/Template/js/jquery.checkbox.js"></script>
<script type="text/javascript">


    $(function() {

        //初始化页面配置
        initPage("脊柱检查测量");

        var app = new Vue({
            el: '#container',
            data: {
            },
            methods: {
                checkRole: function(employeeRoleId, roleId) {
                    var employeeRoleArr = employeeRoleId.split(",");
                    var roleArr = roleId.split(",");

                    var result = false;
                    $.each(roleArr, function(i,val){
                        if($.inArray(val, employeeRoleArr) != -1 || $.inArray((parseInt(val)+100).toString(), employeeRoleArr) != -1){
                            result = true;
                        }
                    });
                    return result;
                },
                cancel: function() {
                    window.location.href = "/wechat/workorder/index/id/{$workorderId}";
                },
                save: function() {

                    var examMeasureSpineId = $("input[name=examMeasureSpineId]").val();
                    var workorderId = $("input[name=workorderId]").val();

                    var spine0 = $("input[name=spine0]").val();
                    var spine1 = $("input[name=spine1]").val();
                    var spine2 = $("input[name=spine2]").val();
                    var spine3 = $("input[name=spine3]").val();
                    var spine4 = $("input[name=spine4]").val();
                    var spine5 = $("input[name=spine5]").val();
                    var spine6 = $("input[name=spine6]").val();
                    var spine7 = $("input[name=spine7]").val();
                    var spine8 = $("input[name=spine8]").val();
                    var spine9 = $("input[name=spine9]").val();
                    var spine10 = $("input[name=spine10]").val();
                    var spine11 = $("input[name=spine11]").val();
                    var spine12 = $("input[name=spine12]").val();
                    var spine13 = $("input[name=spine13]").val();
                    var spine14 = $("input[name=spine14]").val();
                    var spine15 = $("input[name=spine15]").val();
                    var spine16 = $("input[name=spine16]").val();
                    var spine17 = $("input[name=spine17]").val();
                    var spine18 = $("input[name=spine18]").val();
                    var spine19 = $("input[name=spine19]").val();
                    var spine20 = $("input[name=spine20]").val();
                    var pose = $("select[name=pose]").val();

                    var completed = "1";
                    if(isNullOrEmpty(spine0
                            && spine1
                            && spine2
                            && spine3
                            && spine4
                            && spine5
                            && spine6
                            && spine7
                            && spine8
                            && spine9
                            && spine10
                            && spine11
                            && spine12
                            && spine13
                            && spine14
                            && spine15
                            && spine16
                            && spine17
                            && spine18
                            && spine19
                            && spine20
                            && pose
                        )) {
                        completed = "-1";
                    }
                    if(isNullOrEmpty(pose)) {
                        alert("未选择【测量姿态】");
                        return false;
                    }

                    $.ajax({
                        url:"/wechat/workorder/examMeasureSpinePost",
                        type:"post",
                        data:{
                            examMeasureSpineId: examMeasureSpineId,
                            workorderId: workorderId,
                            spine0: spine0,
                            spine1: spine1,
                            spine2: spine2,
                            spine3: spine3,
                            spine4: spine4,
                            spine5: spine5,
                            spine6: spine6,
                            spine7: spine7,
                            spine8: spine8,
                            spine9: spine9,
                            spine10: spine10,
                            spine11: spine11,
                            spine12: spine12,
                            spine13: spine13,
                            spine14: spine14,
                            spine15: spine15,
                            spine16: spine16,
                            spine17: spine17,
                            spine18: spine18,
                            spine19: spine19,
                            spine20: spine20,
                            pose: pose,
                            completed:completed,
                        },
                        dataType:"JSON",
                        beforefootSend:function(){
                            $("#loadingToast").show();
                        },
                        complete:function(){
                            $('#loadingToast').hide();
                        },
                        success:function(data){
                            if(data.code == 200) {
//                                alert(data.alert);
                                alert("保存成功");
                                window.location.href = "/wechat/workorder/index/id/{$workorderId}";
                            }
                        },
                    })

                }
            }
        })
        $(".item select").change(function() {
            var value = $(this).find("option:selected").text();
            $(this).prev().val(value);
        });
    })



</script>

<div class="container" id="container">
    <div class="hint-info">
        <span class="update_time">{$formDict.update_time}：{$examMeasureSpine.update_time}</span>
        <span class="employee_name">{$formDict.update_name}：{$employeeName}</span>
    </div>
    <div class="bg">
        <img class="bg-img" src="http://xwk-file.oss-cn-qingdao.aliyuncs.com/Home/1exam_TLSO_wechat.jpg" alt="bg">
    </div>
    <div class="edit-info">
        <div class="edit-content">
            <input type="text" style="display: none;" name="workorderId" value="{$workorderId}">
            <input type="text" style="display: none;" name="examMeasureSpineId" value="{$examMeasureSpineId}">
            <div class="item">
                <span>测量姿态：</span>
                <input id="pose" type="text" value="{$examMeasureSpine.pose}" readonly placeholder="请选择">
                <select name="pose">
                    <option value="{$examMeasureSpine.pose}">请选择</option>
                    {:getFormDictSelectOption($examMeasureSpine['pose'],'pose','exam_measure_spine',0)}
                </select>
                <img class="icon-right" src="/Template/images/icon-right.png" alt="">
            </div>
            <div class="item" style="border-bottom:0px">
                <span class="itemTitle" style="margin-left: 30%">—— 围长 ——</span><br/>
            </div>
            <div class="item" style="border-bottom:0px"><span>1.围长:</span><input name="spine0" type="text" value="{$examMeasureSpine.spine0}" placeholder="腋窝(mm)" ></div>
            <div class="item" style="border-bottom:0px"><span>2.围长:</span><input name="spine1" type="text" value="{$examMeasureSpine.spine1}" placeholder="乳头连线(mm)" ></div>
            <div class="item" style="border-bottom:0px"><span>3.围长:</span><input name="spine2" type="text" value="{$examMeasureSpine.spine2}" placeholder="剑突(mm)" ></div>
            <div class="item" style="border-bottom:0px"><span>4.围长:</span><input name="spine3" type="text" value="{$examMeasureSpine.spine3}" placeholder="肋骨下沿(mm)" ></div>
            <div class="item" style="border-bottom:0px"><span>5.围长:</span><input name="spine4" type="text" value="{$examMeasureSpine.spine4}" placeholder="腰部(mm)" ></div>
            <div class="item" style="border-bottom:0px"><span>6.围长:</span><input name="spine5" type="text" value="{$examMeasureSpine.spine5}" placeholder="髂前上棘(mm)" ></div>
            <div class="item"><span>7.围长:</span><input name="spine6" type="text" value="{$examMeasureSpine.spine6}" placeholder="大转子(mm)" ></div>
            <div class="item" style="border-bottom:0px">
                <span class="itemTitle" style="margin-left: 30%">—— 左右径 ——</span><br/>
            </div>
            <div class="item" style="border-bottom:0px"><span>8.左右径:</span><input name="spine7" type="text" value="{$examMeasureSpine.spine7}" placeholder="腋窝(mm)" ></div>
            <div class="item" style="border-bottom:0px"><span>9.左右径:</span><input name="spine8" type="text" value="{$examMeasureSpine.spine8}" placeholder="乳头连线(mm)" ></div>
            <div class="item" style="border-bottom:0px"><span>10.左右径:</span><input name="spine9" type="text" value="{$examMeasureSpine.spine9}" placeholder="剑突(mm)" ></div>
            <div class="item" style="border-bottom:0px"><span>11.左右径:</span><input name="spine10" type="text" value="{$examMeasureSpine.spine10}" placeholder="肋骨下沿(mm)" ></div>
            <div class="item" style="border-bottom:0px"><span>12.左右径:</span><input name="spine11" type="text" value="{$examMeasureSpine.spine11}" placeholder="腰部(mm)" ></div>
            <div class="item" style="border-bottom:0px"><span>13.左右径:</span><input name="spine12" type="text" value="{$examMeasureSpine.spine12}" placeholder="髂前上棘(mm)" ></div>
            <div class="item"><span>14.左右径:</span><input name="spine13" type="text" value="{$examMeasureSpine.spine13}" placeholder="大转子(mm)" ></div>
            <div class="item" style="border-bottom:0px">
                <span class="itemTitle" style="margin-left: 30%">—— 前后径 ——</span><br/>
            </div>
            <div class="item" style="border-bottom:0px"><span>15.前后径:</span><input name="spine14" type="text" value="{$examMeasureSpine.spine14}" placeholder="腋窝(mm)" ></div>
            <div class="item" style="border-bottom:0px"><span>16.前后径:</span><input name="spine15" type="text" value="{$examMeasureSpine.spine15}" placeholder="乳头连线(mm)" ></div>
            <div class="item" style="border-bottom:0px"><span>17.前后径:</span><input name="spine16" type="text" value="{$examMeasureSpine.spine16}" placeholder="剑突(mm)" ></div>
            <div class="item" style="border-bottom:0px"><span>18.前后径:</span><input name="spine17" type="text" value="{$examMeasureSpine.spine17}" placeholder="肋骨下沿(mm)" ></div>
            <div class="item" style="border-bottom:0px"><span>19.前后径:</span><input name="spine18" type="text" value="{$examMeasureSpine.spine18}" placeholder="腰部(mm)" ></div>
            <div class="item" style="border-bottom:0px"><span>20.前后径:</span><input name="spine19" type="text" value="{$examMeasureSpine.spine19}" placeholder="髂前上棘(mm)" ></div>
            <div class="item"><span>21.前后径:</span><input name="spine20" type="text" value="{$examMeasureSpine.spine20}" placeholder="大转子(mm)" ></div>

            <div class="item" style="border-bottom:0px">
                <span class="itemTitle"></span>
            </div>

            <!--<div class="line"></div>-->
        </div>
    </div>
    <div class="operation-btn">
        <div class="cancle-btn" v-on:click="cancel">取消</div>
        <if condition="$workorder['status'] eq '-1' && $workorder['creator_id'] eq $customerId">
            <div class="save-btn" v-on:click="save">保存</div>
        </if>
        <if condition="$workorder['status'] eq '2' && $workorder['examinator_id'] eq $customerId && $workorder['exam_time'] eq ''">
            <div class="save-btn" v-on:click="save">保存</div>
        </if>
        <div v-if="{$workorder.status} >= 1 && checkRole('{$role}', '1')">
            <div class="save-btn" v-on:click="save">保存</div>
        </div>
    </div>

</div>
<include file="./Template/footer.html" />